#include <cppunit/CompilerOutputter.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
#include <cppunit/ui/text/TestRunner.h>

#include <glog/logging.h>

int main(int argc, char ** argv) {
	google::InitGoogleLogging(argv[0]);

	// Get the top level suite from the registry
	CppUnit::Test * testSuite =
			CppUnit::TestFactoryRegistry::getRegistry().makeTest();

	CppUnit::TextUi::TestRunner testRunner;
	testRunner.addTest(testSuite);

	// Change the default outputter to a compiler error format outputter
	//runner.setOutputter( new CppUnit::CompilerOutputter(&runner.result(), std::cerr) );

	bool testsWereSucessful = testRunner.run();
	return testsWereSucessful ? 0 : 1;
}
